using System;
using System.Collections.Generic;

namespace Kiwi.Container.DependencyInjection
{
    public static class Properties
    {
        private static readonly Dictionary<string, IEnumerateDependentProperties> _parseTable =
            new Dictionary<string, IEnumerateDependentProperties>(StringComparer.InvariantCultureIgnoreCase)
                {{"all", All}, {"", None}, {"none", None}, {"unset", Unset}};

        public static readonly IEnumerateDependentProperties All = new AllProperties();
        public static readonly IEnumerateDependentProperties None = new NoProperties();
        public static readonly IEnumerateDependentProperties Unset = new UnsetProperties();

        public static IEnumerateDependentProperties Parse(string name)
        {
            IEnumerateDependentProperties result;
            return _parseTable.TryGetValue(name, out result) ? result : None;
        }
    }
}